//
//  VideoModel.m
//  News
//
//  Created by xalo on 16/2/25.
//  Copyright © 2016年 News. All rights reserved.
//

#import "VideoModel.h"

@implementation VideoModel




-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
    }

}

//-(id)copyWithZone:(NSZone *)zone
//{
//    [super copy];
//    return self;
//}

// 归档方法
- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:_ID forKey:@"ID"];
    [aCoder encodeObject:_title forKey:@"title"];
    [aCoder encodeObject:_intro forKey:@"intro"];
    [aCoder encodeObject:_long_title forKey:@"long_title"];
    [aCoder encodeObject:_kpic forKey:@"kpic"];
    [aCoder encodeObject:_category forKey:@"category"];
    [aCoder encodeObject:_url forKey:@"url"];
    [aCoder encodeObject:_source forKey:@"source"];
    [aCoder encodeInteger:_pubDate forKey:@"pubdate"];
    [aCoder encodeObject:_link forKey:@"link"];
    [aCoder encodeInteger:_runtime forKey:@"runtime"];
    [aCoder encodeInteger:_playnumber forKey:@"playnumber"];
    
   

    
}

// 反归档方法
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
    
    self = [super init];
    if (self) {
        
        self.ID = [aDecoder decodeObjectForKey:@"ID"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.intro = [aDecoder decodeObjectForKey:@"intro"];
        self.long_title = [aDecoder decodeObjectForKey:@"long_title"];
        self.kpic = [aDecoder decodeObjectForKey:@"kpic"];
       self.category = [aDecoder decodeObjectForKey:@"category"];
        self.url = [aDecoder decodeObjectForKey:@"url"];
        self.source = [aDecoder decodeObjectForKey:@"source"];
        self.pubDate = [aDecoder decodeIntegerForKey:@"pubdate"];
        self.link = [aDecoder decodeObjectForKey:@"link"];
        self.runtime = [aDecoder decodeIntegerForKey:@"runtime"];
        self.playnumber = [aDecoder decodeIntegerForKey:@"playnumber"];

    }
    return self;
}





@end
